import request from '@/utils/request'

enum API {
  c1_url = '/admin/product/getCategory1',
  c2_url = '/admin/product/getCategory2/',
  c3_url = '/admin/product/getCategory3/',
  getAttrs = '/admin/product/attrInfoList/',
  saveAttr = '/admin/product/saveAttrInfo',
  delAttr = '/admin/product/deleteAttr/',
}
export const reqC1 = () => request.get(API.c1_url)
export const reqC2 = (c1Id: any) => request.get(API.c2_url + c1Id)
export const reqC3 = (c2Id: any) => request.get(API.c3_url + c2Id)
//查找所有属性
export const reqAttrs = (id1: any, id2: any, id3: any) =>
  request.get(API.getAttrs + `${id1}/${id2}/${id3}`)

export const reqSaveAttr = (data: any) => request.post(API.saveAttr, data)

export const reqDelAttr = (id: any) => request.delete(API.delAttr + id)
